package com.huobao.yunying.activitys.muyingquan;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.huobao.yunying.adapters.Adapter_SheQu_HuiTie;
import com.huobao.yunying.https.Http;
import com.huobao.yunying.https.HttpListener;
import com.huobao.yunying.https.HttpUtil;

import android.view.View;

public class Act_SheQu_HuiTie extends Act_SheQu_Base{
    private Adapter_SheQu_HuiTie adapter;
    private List<SheQuHuiTie> datas=new ArrayList<SheQuHuiTie>();
	
    @Override
	protected void onInit() {
      adapter=new Adapter_SheQu_HuiTie(context);
      mListView.setAdapter(adapter);
      GetData();
	}
   
	private void GetData(){
	  Map<String,String> map=HttpUtil.getParams("app","mypost","act","replies");
	  Http.getInstant().sendRequest(context, true, map, new HttpListener() {
		
		@Override
		public void onHttpSuccess(String result) {
			JSONObject jsonobject=JSON.parseObject(result);
			datas=JSON.parseArray(jsonobject.getString("retval"),SheQuHuiTie.class);
			if (datas == null || datas.size() == 0) {
				Rel_empty.setVisibility(View.VISIBLE);
				mListView.setVisibility(View.GONE);
			} else {
				Rel_empty.setVisibility(View.GONE);
				mListView.setVisibility(View.VISIBLE);
				adapter.addAll(datas);
			}
		}
		
		@Override
		public void onHttpError(String error) {
           			
		}
	});
	}

	@Override
	protected String getTitleText() {
		// TODO Auto-generated method stub
		return "我的回帖";
	}
}
